﻿--获取职级异动员工信息
CREATE proc [dbo].[proc_Employee_GradeMove_GetItem]
	@id int
as
	declare @eid int
	set @eid = (select eid from Employee_Grade where id=@id)

	select
	
		Id,
		(select ENumber from Employee E where EId=E.Id) as ENumber,
		(select ETempNumber from Employee E where EId=E.Id) as ETempNumber,
		EId,
		(select EName from Employee E where EId=E.Id) as EName,
		(select Sex from Employee E where EId=E.Id) as Sex,
		(select IDCard from Employee E where EId=E.Id) as IDCard,
		(select CompanyName from Company where id=(select companyid from employee E where EId=E.Id)) as CompanyName,
		(select DName from Department where id=(select departmentid from employee E where EId=E.Id)) as DName,
		(select PostName from Post P where id=(select PostId from employee E where EId=E.Id)) as PostName,
		(select Title from Grade G where id=BGradeId) as BGradeName,
		(select Title from Grade G where id=AGradeId) as AGradeName,
		Item,
		Reason,
		Proposer,
		ApplionTime,
		FirstAudit,
		FirstMemo,
		FirstAuditPerson,
		FirstAuditTime,
		SecondAudit,
		SecondMemo,
		SecondAuditPerson,
		SecondAuditTime

	from Employee_Grade
	where eid=@eid